#include <bits/stdc++.h>

#define debug(a) cout<<#a<<"="<<a<<endl;
constexpr int INF = 0x7fffffff; // 无穷大
typedef long long ll;

using namespace std;

class Solution {
public:
    int minimumChairs(string s) {
        int ans = 0, n = 0;
        for(auto & c : s) {
            if(c == 'E') n++;
            else n--;
            ans = max(ans, n);
        }
        return ans;
    }
};

int main(int argc, const char** argv) {
    Solution s;
    auto res = s.minimumChairs("ELELEEL");
    std::cout << res << std::endl;
    return 0;
}
